package com.luohh.treeroom.controller;


import com.luohh.treeroom.dto.BaseResult;
import com.luohh.treeroom.entity.ProductCategory;
import com.luohh.treeroom.service.IProductCategoryService;
import com.luohh.treeroom.service.impl.ProductCategoryServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 罗辉煌
 * @since 2020-02-15
 */
@Api(value = "分类")
@RestController
@RequestMapping("/product-category")
public class ProductCategoryController {

    @Autowired
    IProductCategoryService productCategoryService;

    @ApiOperation(value = "获取分类列表")
    @RequestMapping(value = "/getList",method = {RequestMethod.POST})
    public BaseResult getList() throws Exception{
        return productCategoryService.getList();
    }

    @RequestMapping(value = "/getDetailList",method = {RequestMethod.POST})
    public BaseResult getDetailList(@RequestBody Integer pid) throws Exception{
        return productCategoryService.getDetailList(pid);
    }
}

